<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\model\Industry
 *
 * @property int $industry_id 行业id
 * @property string|null $name
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry whereIndustryId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property int|null $project_id
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\Industry whereProjectId($value)
 */
class Industry extends Model
{
    protected $table='industry';
    protected $primaryKey='industry_id';
    protected $fillable=['name','project_id'];
    public static function getSelectOptions()
    {
        $options = \DB::table('industry')->select('industry_id as id','name as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->id] = $option->text;
        }
        return $selectOption;
    }
}
